<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <!-- <script src="https://cdn.bootcdn.net/ajax/libs/single-spa/5.9.3/umd/single-spa.min.js"></script> -->

    <script type="module">
        import { registerApplication } from "./single-spa/application/app.js";

        let app1 = {
            bootstrap: [async () => console.log('App 1 开始运行')],
            mount: async () => {
                console.log('App 1 挂载');

            },
            unmount: async () => {
                console.log('App 1 卸载');
            }
        }

        let app2 = {
            bootstrap: [async () => console.log('App 2 开始运行')],
            mount: async () => {
                console.log('App 2 挂载');

            },
            unmount: async () => {
                console.log('App 2 卸载');
            }
        }

        // 注册应用
        registerApplication('a', async () => app1, location => location.hash.startsWith('#/a'));
        registerApplication('b', async () => app2, location => location.hash.startsWith('#/b'));

        // 启动
        // start();


    </script>

</body>

</html>